﻿<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
		<meta name="apple-mobile-web-app-title" content="思路广惠">
		<title>忘记支付密码</title>

		<meta content="telephone=no" name="format-detection" />

		<link rel="stylesheet" type="text/css" href="../../src/css/base.css?1.0" />
	</head>

	<body class="body-bg">
		<header class="header">
			<a href="javascript: history.go(-1)" class="head-le"><i class="iconfont icon-fanhui i2m"></i></a>
			<div class="header-txt">找回支付密码</div>
		</header>
		<section class="top1rem">
			<ul class="setup-u">
				<li class="flexs-al forpwd setup-btm">
					<img class="forpwd-m" src="../../src/images/icon_phone-large.png" />
					<input type="tel" placeholder="手机号" class="typepwd forpwd-inp" />
					<button class="phone-ver" id="phone-ver">获取验证码</button>
				</li>
				<li class="flexs-al forpwd setup-btm">
					<img class="forpwd-m" src="../../src/images/icon_verification.png" />
					<input type="text" placeholder="请输入验证码" class="typepwd forpwd-inp" />
				</li>
				<li class="flexs-al forpwd setup-btm">
					<img class="forpwd-m" src="../../src/images/icon_password_large.png" />
					<input type="password" placeholder="新密码" class="typepwd forpwd-inp" />
				</li>
				<li class="flexs-al forpwd">
					<img class="forpwd-m" src="../../src/images/icon_password_large.png" />
					<input type="password" placeholder="确认新密码" class="typepwd forpwd-inp" />
				</li>
			</ul>
			<div class="own-save">
				<button class="own-save-btn" id="subChange" type="button">
                确认
            </button>
			</div>
		</section>
		<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script src="../../src/js/jquery-md5.js"></script>
		<script src="//cdn.bootcss.com/layer/3.0.1/mobile/layer.js"></script>
		<script src="../../src/js/all.js" type="text/javascript" charset="utf-8"></script>
		<script>
			$("#phone-ver").click(function() {
				if(!(/^1\d{10}$/.test($(".typepwd:eq(0)").val()))) {
					layers("号码输入错误")
				} else {
					$.get(urls + "/WorkMembers/SendVer", {
						Phone: $(".typepwd:eq(0)").val(),
						AppID: AppID,
						Token: Token
					}, function(res) {
						layers(res.Return_Mess, function() {
							$("#phone-ver").attr("disabled", "disabled");
							$("#phone-ver").css("color", "#333");
							var n = 30,
								m = setInterval(function() {
									$("#phone-ver").html(n-- + "s");
									!n && (clearInterval(m), $("#phone-ver").removeAttr("disabled"), $("#phone-ver").html("获取验证码"), $("#phone-ver").css("color", "#huef36"));
								}, 500)
						});
					})
				}
			});

			$("#subChange").click(function() {
				var typepwd = $(".typepwd");

				if(!(/^1\d{10}$/.test(typepwd.eq(0).val()))) {
					layers("请输入号码");
				} else if(!typepwd.eq(1).val()) {
					layers("请输入验证码");
				} else if(!typepwd.eq(2).val()) {
					layers("请输入新密码");
				} else if(typepwd.eq(3).val() !== typepwd.eq(2).val()) {
					layers("两次新密码不相同");
				} else {
					$.post(urls + "/WorkMembers/FindPwd", {
						UserID: MembersID,
						PwdType: "pay",
						PwdNew: $.md5(typepwd.eq(2).val()),
						Ver: $.md5(typepwd.eq(1).val()),
						AppID: AppID,
						Token: Token
					}, function(res) {
						layers(res.Return_Mess);
					})
				}
			});
		</script>
	</body>

</html>